package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * Created by LN on 2017/7/11.16:02
 */
@Entity
@Table(name = "draw_jackpot")
@DynamicInsert
public class DrawJackpotEntity extends BaseEntity {
    private String prizeNo;
    private String activityCode;
    private String prizeCode;
    private String prizeName;
    private String isOccupied;
    private BigDecimal value;

    @Basic
    @Column(name = "prize_no")
    public String getPrizeNo() {
        return prizeNo;
    }

    public void setPrizeNo(String prizeNo) {
        this.prizeNo = prizeNo;
    }

    @Basic
    @Column(name = "activity_code")
    public String getActivityCode() {
        return activityCode;
    }

    public void setActivityCode(String activityCode) {
        this.activityCode = activityCode;
    }

    @Basic
    @Column(name = "prize_code")
    public String getPrizeCode() {
        return prizeCode;
    }

    public void setPrizeCode(String prizeCode) {
        this.prizeCode = prizeCode;
    }

    @Basic
    @Column(name = "prize_name")
    public String getPrizeName() {
        return prizeName;
    }

    public void setPrizeName(String prizeName) {
        this.prizeName = prizeName;
    }

    @Basic
    @Column(name = "is_occupied")
    public String getIsOccupied() {
        return isOccupied;
    }

    public void setIsOccupied(String isOccupied) {
        this.isOccupied = isOccupied;
    }

    @Basic
    @Column(name = "value")
    public BigDecimal getValue() {
        return value;
    }

    public void setValue(BigDecimal value) {
        this.value = value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DrawJackpotEntity that = (DrawJackpotEntity) o;

        if (prizeNo != null ? !prizeNo.equals(that.prizeNo) : that.prizeNo != null) return false;
        if (activityCode != null ? !activityCode.equals(that.activityCode) : that.activityCode != null) return false;
        if (prizeCode != null ? !prizeCode.equals(that.prizeCode) : that.prizeCode != null) return false;
        if (prizeName != null ? !prizeName.equals(that.prizeName) : that.prizeName != null) return false;
        if (isOccupied != null ? !isOccupied.equals(that.isOccupied) : that.isOccupied != null) return false;
        if (value != null ? !value.equals(that.value) : that.value != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = prizeNo != null ? prizeNo.hashCode() : 0;
        result = 31 * result + (activityCode != null ? activityCode.hashCode() : 0);
        result = 31 * result + (prizeCode != null ? prizeCode.hashCode() : 0);
        result = 31 * result + (prizeName != null ? prizeName.hashCode() : 0);
        result = 31 * result + (isOccupied != null ? isOccupied.hashCode() : 0);
        result = 31 * result + (value != null ? value.hashCode() : 0);
        return result;
    }
}
